import requests
from patagent.model import ApiRequest
from langchain_core.tools import tool


@tool
def http_get_request(url: str, parameters: dict):
    """request a `GET` method with url and parameters"""
    return requests.request('GET', url, params=parameters)

@tool
def http_post_request(url: str, parameters: dict):
    """request a `POST` method with url and parameters"""
    return requests.request('POST', url, json=parameters)
